home *** CD-ROM | disk | FTP | other *** search
- /****i* SOURCE_FILE/INFO
- *
- * NAME
- * Locale.js
- *
- * USAGE
- * Part of Netobjects JavaScript Library.
- *
- * COPYRIGHT
- * Copyright ⌐ 2000-2005 Website Pros, Inc.
- * All Rights Reserved.
- *
- * This is an unpublished work protected by Website Pros, Inc.
- * as a trade secret, and is not to be used or disclosed except as
- * expressly provided in a written license agreement executed by
- * you and Website Pros, Inc.
- *
- * <copyright@websitepros.com>
- *
- * NOTES
- * JavaScript code.
- *
- *****/
-
- if (!IS.isModuleInitialized("IS.NOF.UTIL.Locale"))
- {
-
- /****h* NOF_JavaScript_Library/NOF.UTIL.Locale
- *
- * NAME
- * NOF.UTIL.Locale
- *
- * DESCRIPTION
- * A Locale object represents a specific geographical, political, or cultural region.
- * Usage:
- * new NOF.UTIL.Locale('de','DE');
- *
- ****/
-
- /**
- * Constructor
- * @param language
- * @param country
- */
- function UTIL_Locale(/*string*/ language, /*string*/ country) {
- this.__proto__ = UTIL_Locale.prototype;
-
- this.language = language;
- this.country = country;
- }
- {
-
- var method = UTIL_Locale.prototype;
-
- /**
- * Returns the language code for this locale.
- **/
- method.getLanguage = function () {
- return this.language;
- }
-
- /**
- * Returns the country code for this locale.
- **/
- method.getCountry = function () {
- return this.country;
- }
-
- /**
- * Returns the string representation for this locale as Language_Country ('de_DE').
- **/
- method.toString = function () {
- var toRetStr = this.language;
- if ( this.country != null ) {
- toRetStr += "_" + this.country;
- }
- return toRetStr;
- }
-
- /**
- * Equals method.
- **/
- method.equals = function (/*NOF.UTIL.Locale*/ locale) {
- return ((locale != null) && (typeof(locale) == 'object' ) &&
- (this.language == locale.language) && (this.country == locale.country));
- }
-
- /**
- * Return the default locale
- **/
- method.getDefault = function () {
- return NOF.UTIL.DefaultLocale;
- }
- }
-
- UTIL.__proto__.Locale = UTIL_Locale;
- }